﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MyVoteMVC.Web.Models.Item>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    投票结果
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="demo" class="demo">
        <%foreach (IGrouping<string, Item> Group in Model.GroupBy(o => o.QID))
          {%>
        <ul class="splitter">
            <li>
                <%= Group.First().QuestionTitle %></li>
        </ul>
        <ul id="list-<%= Group.Key %>" class="image-grid imagelist">
        <%= Html.Telerik().Chart(Group)
            .Name("chart-"+Group.First().QuestionNo)
            .Theme("Black")
            .Title(title => title
                .Text("投票结果显示")
            )
            .Legend(legend => legend
                .Position(ChartLegendPosition.Bottom)
            )
            .SeriesDefaults(series => {
                series.Bar().Stack(false);                
            })
            .Series(series => {
                series.Bar(s => s.Online_Count).Name("在线");
                series.Bar(s => s.Offline_Count).Name("离线");               
            })
            .CategoryAxis(axis => axis
                .Categories(s => s.Title)
            )
            .ValueAxis(axis => axis
               .Numeric().Labels(labels => labels.Visible(true).Format("{0}票"))
            )
            .Tooltip(tooltip => tooltip
                .Visible(true)
            )
            .HtmlAttributes(new { style = "width: 600px;height:" +(Group.Count()*50).ToString() + "px;" })
    %>
        </ul>
        <%
           } %>
    </div>


</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
<link href="/Content/quicksand/quicksand.css" rel="stylesheet" type="text/css" />
    <link href="/Content/fancybox/jquery.fancybox.css" rel="stylesheet" type="text/css" />
    <link href="/Content/fancybox/helper/jquery.fancybox-buttons.css" rel="stylesheet"
        type="text/css" />
</asp:Content>
